package com.xinhe.web.controller;

import com.querydsl.core.QueryResults;
import com.xinhe.web.annotation.WebUsed;
import com.xinhe.web.common.Result;
import com.xinhe.web.entity.SellerShopType;
import com.xinhe.web.service.SellerShopTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "商家店铺分类", tags = {"商家店铺分类"})
@RestController
@RequestMapping(value = {"/sellerShopType"}, produces = {"application/json;charset=UTF-8"})

public class SellerShopTypeController {
    @Autowired
    private SellerShopTypeService sellerShopTypeService;

    @WebUsed
    @ApiOperation(httpMethod = "GET", value = "分页查询商家店铺分类")
    @RequestMapping({"/pageSellerShopType"})
    public QueryResults<SellerShopType> pageSellerShopType(String name,int pageNum, int pageSize) {
        return this.sellerShopTypeService.pageSellerShopType(name,pageNum,pageSize);
    }
    @WebUsed
    @ApiOperation(httpMethod = "POST", value = "保存商家店铺分类")
    @RequestMapping({"/saveSellerShopType"})
    public Result saveSellerShopType(Long id,String name,String remark) {
        return this.sellerShopTypeService.saveModel(id, name, remark);
    }
    @WebUsed
    @ApiOperation(httpMethod = "GET", value = "删除商家店铺分类")
    @ApiImplicitParam(name = "sellerShopTypeId", value = "标识", required = true)
    @RequestMapping({"/deleteSellerShopType"})
    public Result deleteSellerShopType(Long sellerShopTypeId) {
        return this.sellerShopTypeService.delete(sellerShopTypeId);
    }
    @WebUsed
    @ApiOperation(httpMethod = "GET", value = "商家店铺分类详情")
    @ApiImplicitParam(name = "sellerShopTypeId", value = "标识", required = true)
    @RequestMapping({"/detailSellerShopType"})
    public Result<SellerShopType> detailSellerShopType(Long sellerShopTypeId) {
        return this.sellerShopTypeService.findById(sellerShopTypeId);
    }
}
